import os

conf_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.dirname(conf_path)
template_path = conf_path + '/uwsgi_template.ini'
result_path = conf_path + '/uwsgi.ini'

f_r = open(template_path, 'r')
f_w = open(result_path, 'w')

content = f_r.read()
content = content.replace('@ROOT_PATH', root_path).replace('@CONF_PATH', conf_path)
f_w.write(content)
f_r.close()
f_w.close()

